﻿@inject IJSRuntime JSRuntime
@inject IStringLocalizer<Resource> _localizer
<div class="easymde-wrapper">
    <textarea id="bf_editor" tabindex="2" class="visually-hidden" placeholder="@_localizer["type-here"]"></textarea>
</div>

@code {
    [Parameter] public string Content { get; set; }
    [Parameter] public string Toolbar { get; set; }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            await JSRuntime.InvokeAsync<string>("commonJsFunctions.loadEditor", Toolbar);
        }

        await JSRuntime.InvokeAsync<string>("commonJsFunctions.setEditorValue", Content );
    }
}
